package com.atguigu.tingshu.common.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class KafkaService {

    private static final Logger logger = LoggerFactory.getLogger(KafkaService.class);

    @Autowired
    private KafkaTemplate kafkaTemplate;
    /**
     * @description: 初始化用户的账户数据，向MQ中发送消息
     * @author Petrichor
     * @date 2023/12/23 20:34
     * @param topic 主题
     * @param value 值
     * @return
    **/
    public void sendMsg(String topic , String value) {
        kafkaTemplate.send(topic , null , value) ;
    }
}
